package com.baizhi.service.impl;

import com.baizhi.dao.BookDao;
import com.baizhi.entity.Book;
import com.baizhi.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class BookServiceImpl implements BookService {
    @Autowired
    private BookDao bookDao;
    @Override
    public List<Book> selectBook(String bookName) {
        List<Book> books = bookDao.selectBook(bookName);
        return books;
    }

    @Override
    public void insertBook(Book book) {
        bookDao.insertBook(book);
    }

    @Override
    public void deleteBook(Integer bookId) {
        bookDao.deleteBook(bookId);
    }

    @Override
    public Book selectOneBook(Integer bookId) {
        Book book = bookDao.selectOneBook(bookId);
        return book;
    }

    @Override
    public void updateBook(Book book) {
        bookDao.updateBook(book);
    }
}
